package cn.stylefeng.guns.modular.api.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@SuppressWarnings("rawtypes")
@ApiModel
public class DepartmentDTO implements Comparable{

	public DepartmentDTO(String name, String value, Integer pri, String pageType) {
		this.name = name;
		this.value = value;
		this.pri = pri;
		this.pageType = pageType;
	}
	
	@ApiModelProperty("科室名称")
	private String name;
	@ApiModelProperty("点击跳转地址")
	private String value;
	@ApiModelProperty("排序号")
	private Integer pri;
	@ApiModelProperty("页面类型")
	private String pageType;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Integer getPri() {
		return pri;
	}

	public void setPri(Integer pri) {
		this.pri = pri;
	}

	public String getPageType() {
		return pageType;
	}

	public void setPageType(String pageType) {
		this.pageType = pageType;
	}

	@Override
	public int compareTo(Object o) {
		if(o instanceof DepartmentDTO){
			DepartmentDTO emp = (DepartmentDTO) o;
			if(this.pri == null){
				return 1;
			}else if(emp.pri == null){
				return -1;
			}
			return this.pri.compareTo(emp.pri);
        }
		return 0;
	}
	
}
